From 2ed4d133587eb55562c419dddaccce9bdc779319 Mon Sep 17 00:00:00 2001 From: robertl Date: Mon, 23 Nov 2009 06:17:45 +0000 Subject: [PATCH] Fix mem leaks in teletype. --- teletype.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/teletype.c b/teletype.c index 848215913..c4f301c42 100644 --- a/teletype.c +++ b/teletype.c @@ -60,8 +60,8 @@ teletype_read(void) int i; for (i = 0; i < tty_wpt_count; i++) { waypoint *wpt = waypt_new(); - wpt->shortname = xstrdup(gbfgetcstr(fin)); - wpt->description = xstrdup(gbfgetcstr(fin)); + wpt->shortname = (gbfgetcstr(fin)); + wpt->description = (gbfgetcstr(fin)); if (1) { // needs bit values of NEWFORMAT2 int direction = gbfgetuint32(fin); @@ -73,6 +73,7 @@ teletype_read(void) // probably could treat as a pascal string char *junk = xmalloc(len); gbfread(junk, len, 1, fin); + xfree(junk); } wpt->latitude = gbfgetint32(fin) / 1000000.0 ; wpt->longitude = gbfgetint32(fin) / 1000000.0 ; -- 2.30.2